using System;
using System.Collections.Generic;
using System.Text;
using Koda.VisualStudio;
using Koda.UI;
using Koda.Search;
using Koda.VisualStudio.Integration;
using System.Windows.Forms;
using Koda.Search.Finders;

namespace Koda.Commands
{
    public class OpenMemberCommand : VsCommand
    {
        public OpenMemberCommand()
            : base("Open Member ...", "MenuBar.Tools", 1)
        {
        }

        public override void OnExecute(VsCommandEventArgs e)
        {
            MemberFinder memberFinder = new MemberFinder(e.DTE);
            OpenForm form = new OpenForm(memberFinder);
            if (form.ShowDialog() == DialogResult.OK)
            {
                if (e.DTE.ActiveWindow != null)
                {
                    e.DTE.ActiveWindow.SetFocus();
                }
            }
        }
    }
}
